package fr.vvins.core.search.query;

import java.util.HashMap;

public class SearchFacetResult extends SearchResult{
	
    private HashMap<String, HashMap<String,Long>> facetScore;
    
	public void addFacetScore(String name, String value, long score) {
		if(facetScore == null){
			facetScore = new HashMap<String, HashMap<String,Long>>();
		}
		HashMap<String,Long> scores;
		if(facetScore.containsKey(name)){
			scores = facetScore.get(name);
			scores.put(value, score);
		} else {
			scores = new HashMap<String,Long>();
			scores.put(value, score);
		}
		facetScore.put(name,scores);
	}
	
	public void clearFacetScore(String name) {
		if(facetScore == null){
			facetScore = new HashMap<String, HashMap<String,Long>>();
		}
		facetScore.put(name,new HashMap<String,Long>());
	}

	public HashMap<String, HashMap<String,Long>> getFacetScore() {
		return facetScore;
	}

	public void setFacetScore(HashMap<String, HashMap<String,Long>> facetScore) {
		this.facetScore = facetScore;
	}
    
}
